/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-02-20 10:15:35
 * @Description  : 用户代理字段的操作系统和浏览器图标
 */

import type { IndexObj } from '@/types/commom'

export const osArr: IndexObj = {
  Windows: 'Windows',
  'Mac OS': 'ios',
  Linux: 'ziyuan2',
  Android: 'Android',
  iOS: 'icons8-mac-os'
}

export const browserArr: IndexObj = {
  Chrome: 'chrome',
  Firefox: 'huohuliulanqi',
  Safari: 'Safari',
  Edge: 'Edge-01',
  IE: 'IE',
  Opera: 'opera'
}

export const getIcon = (key: string) => {
  if (Object.keys(browserArr).includes(key)) {
    return browserArr[key]
  }

  if (Object.keys(osArr).includes(key)) {
    return osArr[key]
  }

  return undefined
}
